    <div class="container">
      <div class="bg-putih">
        <div class="jdl-page">
          <?php echo isset($judul)?$judul:'<font color="#ccc">Judul Belum Diberikan</font>'; ?>
          <div class="clearfix"></div>
        </div>

        <?php echo display_flash(); ?>
        <?php $filter = $this->session->userdata('filter');?>

        <div class="row">
          <div class="col-xs-8">
            <div class="btn-group btn-group-sm" role="group">
              <a href="<?php echo site_url('obat_data/add'); ?>" class="btn btn-primary"><i class="fa fa-plus"></i>&nbsp;Tambah</a>
              <?php if($this->uri->segment(2) == "search"): ?>
                <?php $keyword = $this->session->userdata('keyword_obat'); ?>
                <a href="<?php echo site_url("obat_data/excel/$filter/$keyword"); ?>" class="btn btn-warning"><i class="fa fa-file-excel-o"></i>&nbsp;Unduh Excel</a>
              <?php elseif($this->uri->segment(2) == ""): ?>
                <a href="<?php echo site_url('obat_data/excel'); ?>" class="btn btn-warning"><i class="fa fa-file-excel-o"></i>&nbsp;Unduh Excel</a>
              <?php endif; ?>
            </div>
          </div>
          <div class="col-xs-4">
            <?php echo form_open('obat_data/search'); ?>
            <div class="input-group-3">              
              <button type="submit" class="btn btn-primary btn-sm"><span class="glyphicon glyphicon-search"></span></button>
              <select name="filter" class="form-control input-sm">
                <?php if($filter == 'by_name'): ?>
                  <option value="by_name" selected="selected">Nama</option>
                <?php else: ?>
                  <option value="by_name">Nama</option>
                <?php endif; ?>
                
                <?php if($filter == 'by_code'): ?>
                  <option value="by_code" selected="selected">Kode</option>
                <?php else: ?>
                  <option value="by_code">Kode</option>
                <?php endif; ?>

                <?php if($filter == 'by_info'): ?>
                  <option value="by_info" selected="selected">Indikasi</option>
                <?php else: ?>
                  <option value="by_info">Indikasi</option>
                <?php endif; ?>
              </select>
              <input type="text" class="form-control input-sm" name="keyword" placeholder="Cari obat" value="<?=$this->session->userdata('keyword_obat');?>" />
            </div>
            <?php echo form_close(); ?>
          </div>
        </div>

        <table class="table table-striped table-hover margintop20">
          <thead>
            <tr>
              <th width="3%" style="text-align:center;">No</th>
              <th width="3%">Kode</th>
              <th>Nama Obat</th>
              <th>Kelompok</th>
              <th>Min. Dosis</th>
              <th>Max. Dosis</th>
              <th>Satuan</th>
              <th>Satuan Dosis</th>
              <th>Informasi</th>
            </tr>
          </thead>
          <tbody>
            <?php 
            if(!empty($results)){
              foreach ($results as $row) {
                ?>
                <tr>
                  <td align="center"><?php echo $ordinal_num++ ?></td>
                  <td><?php echo $row['KdObat']?></td>
                  <td><?php echo $row['NmObat']?></td>
                  <td><?php echo $row['NmKelompok']?></td>
                  <td><?php echo $row['MinDosis']?></td>
                  <td><?php echo $row['MaxDosis']?></td>
                  <td><?php echo $row['Satuan']?></td>
                  <td><?php echo $row['SatuanDosis']?></td>
                  <td>
                    <?php echo trim_text($row['Informasi'], 10)?>
                    <span class="pull-right">
                      <?php echo edit('Edit',site_url('obat_data/edit/' . $row['KdObat']), 'label label-success',$row['NmObat']);?>
                      <?php echo delete('Hapus',site_url('obat_data/delete/' . $row['KdObat']), 'label label-default',$row['NmObat']);?>
                    </span>
                  </td>
                </tr>
                <?php 
              }
            }else{
              ?>
              <tr>
                <td colspan="9" align="center">Tidak ada data</td>
              </tr>
              <?php
            }
            ?>
          </tbody>
        </table>

        <center style="margin-top:-30px;">
          <ul class="pagination">
            <?php echo $pagination; ?>
          </ul>
        </center>

        <div class="clearfix"></div>
      </div>
    </div> <!-- /container -->